package src.lab03.test08;

import java.io.*;

/**
 * Created by 阿阿阿阿豪丶 on 2017/12/15.
 */
public class Test {
    public static void main(String[] args) {
        String path = "D:/Book.txt";
        String path1 = "D:/book1.txt";
        String path2 = "D:/test.txt";
        try {
            FileInputStream fileInputStream = new FileInputStream(path);
            FileInputStream fileInputStream1 = new FileInputStream(path1);
            FileOutputStream fileOutputStream = new FileOutputStream(path2);
            int content = 1;
            int content1 = 1;

            while ((content = fileInputStream.read())!=-1||((content1 = fileInputStream1.read())!=-1)){
                fileOutputStream.write(content);
                fileOutputStream.write(content1);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }


    }

}
